<template>
  <div class="ifPay">
    <van-overlay :show="show" @click="show = false">
      <div class="wrapper" @click.stop>
        <van-loading size="24px">支付中...</van-loading>
      </div>
    </van-overlay>
  </div>
</template>
<script>
export default {
  data() {
    return {
      show: true
    };
  },
  created() {
    console.log(window.location.href)
    //获取当前页面的url
    const path = window.location.href.split("?");
    const str = path[1];
    this.$api.pay.ifAliPay(str).then(res => {
        if (res.data.code === 200) {
        this.$router.push("/paySuccess");
        } else {
        this.$router.push("/payFailure");
        }
    })
  }
};
</script>
<style lang="less" scoped>
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.block {
  width: 120px;
  height: 120px;
  background-color: #fff;
}
</style>
